from core.basehandler import BaseHandler
from core.room import Room
from core.action import Action
from core.support import set_cutscene

class dancefloor(Room):
    def __init__(self, room_id):
        Room.__init__(self, room_id)    # do basic initialization for every room
        
        # build list of actions
        self.add_action(wall)
        self.add_action(restroom)
        self.add_action(tables)
        self.add_action(food)
        self.add_action(bar)
        self.add_action(dance)
        self.add_action(askbecky)
    
    # return description of room.
    def get_description(self):
        return "So you think you can dance? Bust a move playa."
    
    # return image of room
    def get_image(self):
        return 'dancefloor.JPG'


class DanceFloorHandler(BaseHandler):
    
    # return class to use to create a new instance of this room
    def get_room_class(self):
        return dancefloor

# define actions for this room

class wall(Action):
    def __init__(self):
        Action.__init__(self, "wall")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to the Sad and Lonely Corner"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'wall'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"

class restroom(Action):
    def __init__(self):
        Action.__init__(self, "restroom")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to Restrooms"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'restroom'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    

class tables(Action):
    def __init__(self):
        Action.__init__(self, "tables")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to Your Table"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'tables'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"
    

class food(Action):
    def __init__(self):
        Action.__init__(self, "food")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to the Buffet"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'food'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"



class bar(Action):
    def __init__(self):
        Action.__init__(self, "bar")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Go to the Bar"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'bar'
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"

class dance(Action):
    def __init__(self):
        Action.__init__(self, "dance")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Dance Like a Muthaf****"
    
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'dancefloor'
    
    def do_action(self,game,room,request):
        set_cutscene("You are an amazing dancer and everyone looks on in awe. You gain an interaction point. Smooth.")
        game.social+=1
        self.usable = False
        return
    
class askbecky(Action):
    def __init__(self):
        Action.__init__(self, "askbecky")    # do basic initialization for every action
    
    # return description of action (used in label on webpage)
    def get_description(self):
        return "Ask Cousin Becky to Dance"
    
    # return id of room to enter when action is complete
    # return id of room to enter when action is complete
    def get_destination(self):
        return 'loserroom'
    
    # set cutscene for when arrive in outside
    def do_action(self,game,room,request):
        set_cutscene("She's 14 for god's sake!!")
        return
    
    # return http method to use when user clicks on this action
    # use "get" if just moving to another room.  if changing something
    # like the state of an inventory item or room then use "post"
    def get_method(self):
        return "get"